EnableExtension and DisableExtension DBus methods on org.gnome.Shell.
</_description>
</key>
- <key name="enable-app-monitoring" type="b">
- <default>true</default>
- <_summary>Whether to collect stats about applications usage</_summary>
- <_description>
- The shell normally monitors active applications in order to present
- the most used ones (e.g. in launchers). While this data will be
- kept private, you may want to disable this for privacy reasons.
- Please note that doing so won't remove already saved data.
- </_description>
- </key>
<key name="favorite-apps" type="as">
<default>[ 'epiphany.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>
<_summary>List of desktop file IDs for favorite applications</_summary>
global.settings.connect('changed::app-folder-categories', Lang.bind(this, function() {
Main.queueDeferredWork(this._allAppsWorkId);
}));
- global.settings.connect('changed::enable-app-monitoring',
- Lang.bind(this, this._updateFrequentVisibility));
+ this._privacySettings = new Gio.Settings({ schema: 'org.gnome.desktop.privacy' });
+ this._privacySettings.connect('changed::remember-app-usage',
+ Lang.bind(this, this._updateFrequentVisibility));
this._views = [];
},
_updateFrequentVisibility: function() {
- let enabled = global.settings.get_boolean('enable-app-monitoring');
+ let enabled = this._privacySettings.get_boolean('remember-app-usage');
this._views[Views.FREQUENT].control.visible = enabled;
let visibleViews = this._views.filter(function(v) {
* minutes to signify idle.
*/
-#define ENABLE_MONITORING_KEY "enable-app-monitoring"
+#define PRIVACY_SCHEMA "org.gnome.desktop.privacy"
+#define ENABLE_MONITORING_KEY "remember-app-usage"
#define FOCUS_TIME_MIN_SECONDS 7 /* Need 7 continuous seconds of focus */
GFile *configfile;
GDBusProxy *session_proxy;
GdkDisplay *display;
+ GSettings *privacy_settings;
gulong last_idle;
guint idle_focus_change_id;
guint save_id;
- guint settings_notify;
gboolean currently_idle;
gboolean enable_monitoring;
restore_from_file (self);
- self->settings_notify = g_signal_connect (shell_global_get_settings (global),
- "changed::" ENABLE_MONITORING_KEY,
- G_CALLBACK (on_enable_monitoring_key_changed),
- self);
+ self->privacy_settings = g_settings_new(PRIVACY_SCHEMA);
+ g_signal_connect (self->privacy_settings,
+ "changed::" ENABLE_MONITORING_KEY,
+ G_CALLBACK (on_enable_monitoring_key_changed),
+ self);
update_enable_monitoring (self);
}
static void
shell_app_usage_finalize (GObject *object)
{
- ShellGlobal *global;
ShellAppUsage *self = SHELL_APP_USAGE (object);
if (self->save_id > 0)
g_source_remove (self->save_id);
- global = shell_global_get ();
- g_signal_handler_disconnect (shell_global_get_settings (global),
- self->settings_notify);
+ g_object_unref (self->privacy_settings);
g_object_unref (self->configfile);
static void
update_enable_monitoring (ShellAppUsage *self)
{
- ShellGlobal *global;
gboolean enable;
- global = shell_global_get ();
- enable = g_settings_get_boolean (shell_global_get_settings (global),
+ enable = g_settings_get_boolean (self->privacy_settings,
ENABLE_MONITORING_KEY);
/* Be sure not to start the timers if they were already set */